
<template>
  <div class="zhika base-background-img">
    <ul class="ul-item-content">
      <li class="li-item-content" v-for='(item, index) in tabs' :key="index" :class="{'active': item.isSelected}" @click="swiper(item)">
        <img :src="item.img" alt="">
      </li>
    </ul>
    <div class="content">
        <div class="img4" @click="swiper(img4)">
            <img src="static/robot/5/4.png">
        </div>
        <div class="img5" @click="swiper(img5)">
            <img src="static/robot/5/5.png">
        </div>
    </div>
    <c-pdf @closePdf="closePdf" v-if="isshowpdf" :info="info" :infourl="pdfurl"></c-pdf>
  </div>
</template>

<script>
  import STATICPATH from '../../config.js'
  export default {
    name: 'zhika',
    data () {
      return {
        isshowpdf: false,
        ishsowvideo: false,
        info: '',
        infourl: '',
        img4: {
          url: 'static/robot/pdf/3/【课程讲义】——星光投射灯.pdf',
          data: [{
            isSelected: 1,
            name: '星光投射灯—《抢凳子》',
            url: STATICPATH + '/robot/3/纸卡/qiangdengzi.mp4'
          }]
        },
        img5: {
          url: 'static/robot/pdf/3/【课程讲义】——太阳系.pdf',
          data: [{
            isSelected: 1,
            name: '太阳系',
            url: STATICPATH + '/robot/3/纸卡/taiyangxi.mp4'
          }]
        },
        tabs: [{
          img: 'static/robot/5/1.png',
          url: 'static/robot/pdf/1/【课程讲义】——小小苹果树.pdf',
          data: [{
            isSelected: 1,
            name: '小小苹果树—Apple tree',
            url: STATICPATH + '/robot/1/纸卡/apple tree.mp4'
          }]
        },
        {
          img: 'static/robot/5/2.png',
          url: 'static/robot/pdf/2/【课程讲义】——唱歌鹦鹉.pdf',
          data: []
        },
        {
          img: 'static/robot/5/3.png',
          url: 'static/robot/pdf/2/【课程讲义】——简易动画机.pdf',
          data: []
        }]
      }
    },
    methods: {
      swiper: function (item) {
        console.log(item)
        this.info = item.data
        this.pdfurl = item.url
        this.isshowpdf = true
      },
      closePdf: function () {
        this.isshowpdf = false
      }
    }
  }
</script>

<style scoped>
.zhika > div {
  position: absolute; 
}
.ul-item-content {
  margin: 0;
  padding: 0;
  list-style-type: none;
  z-index: 10;
  top: 280px;
  left: 190px;
  width: 910px;
  height: 480px;
  position: absolute;
}
.li-item-content {
  cursor: pointer;
  float: left;
  margin: 15px 20px;
  position: initial;
}
.content{
    position: absolute;
    width:950px;
    height:150px;
    top:350px;
    left:190px;
}
.img4{
    left:120px;
    top:65px;
    position: absolute;
    z-index: 100;
}
.img5{
    left:450px;
    top:65px;
    position: absolute;
    z-index: 100;
}
</style>
